package org.dromara.comm_lhz.controller;

import org.dromara.comm_lhz.entity.AsSearchHistoryEntity;
import org.dromara.comm_lhz.service.AsSearchHistoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * 搜索历史
 */

@RestController
@RequestMapping("/asSearchHistory")
public class AsSearchHistoryController {

    @Autowired
    private AsSearchHistoryService asSearchHistoryService;


    /**
     * 查询搜索历史
     */
    @GetMapping("/selSearchHistory")
    public List<AsSearchHistoryEntity> selSearchHistory() {
        return asSearchHistoryService.selSearchHistory();
    }

    /**
     * 添加搜索历史
     */
    @PostMapping("/addSearchHistory")
    public void addSearchHistory(@RequestBody AsSearchHistoryEntity asSearchHistoryEntity) {
        asSearchHistoryService.addSearchHistory(asSearchHistoryEntity);
    }
    /**
     * 清空搜索历史
     */
    @PostMapping("/deleteSearchHistory")
    public void deleteSearchHistory() {
        asSearchHistoryService.deleteSearchHistory();
    }

    /**
     * 修改搜索历史
     */
    @PostMapping("/updateSearchHistory")
    public void updateSearchHistory(@RequestBody AsSearchHistoryEntity asSearchHistoryEntity) {
        asSearchHistoryService.updateById(asSearchHistoryEntity);
    }





}
